import java.util.HashSet;
import java.util.Set;


public class Polynom {
	Set<Monom> monoms;
	
	public Polynom(){
		monoms=new HashSet<Monom>();
	}
	
	public void addMonom(Monom monom) {
		monoms.add(monom);
		
	}

	public complex calcPolynom(int i, int size) {
		complex sum=new complex(0,0);
		for (Monom mon : monoms) {
			sum.addComplex(complex.mulComplex(Algorithm.chi(size, i, mon.character()), mon.mekadem()));
		}
		return sum;
	}

}
